<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
    function searchRight11(clinicId,id){
        $("#nameDj").attr("disabled","true")
        loadDiv('hospitalRegistrLeft','${ctx}/doctor/liveRequisition/hospitalRegistrLeft?clinicId='+clinicId+"&id="+id)
    }
//    $("#btnSubmit").on('click',function(clinicId){
    function submitSearchForm1(clinicId){
//        if(clinicId==''||clinicId==null){
//            toastr.error('请先选择登记患者');
//        }else{
//
//        }
        if ($('#searchForm1').parsley().validate()) {
            if (flag) {
                flag = false;
                $("#name").removeAttr("disabled");
                $("#searchForm1").ajaxSubmit({
                    type: 'post', // 提交方式 get/post
                    url:'${ctx}/doctor/patVisit/saveInformation?clinicId='+clinicId, // 需要提交的 url
                    success: function(data) { // data 保存提交后返回的数据，一般为 json 数据
                        if (data.code == "success") {
                            toastr.success(data.data);
                            loadDiv("mainCenterDiv", '${ctx}/finance/patPrepayment/depositAmountIndex?visitId='+data.dataMap.visitId);
                        }
                        else {
                            flag = true;
                            toastr.error(data.data);
                        }
                    }
                });
            }
        }
        return false;
    }
            <%--formSaveLoad('mainCenterDiv','searchForm1','${ctx}/doctor/patVisit/saveInformation?clinicId='+clinicId,'${ctx}/finance/patPrepayment/depositAmountIndex?visitId='+${visitId});--%>
    IDC("icdName");
    function IDC(inputId){
        var url="${ctx}/doctor/hisDataIcd10/automaticIcd";
        autoComplete(inputId,url,function(data){
            var rows = [];
            for(var i=0; i<data.length; i++){
                rows[rows.length] = {
                    data:data[i],
                    value:data[i].id,
                    result:data[i].keywordShuoming
                };
            }
            return rows;
        },function(data, i, max){
            return data.zhongwenMingcheng;
        },function(event, data,formatted){
            $("#IDCName").val(data.zhongwenMingcheng);
            $("#code").val(data.pinyinIndex);
        })
    }

</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li>
                <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/doctor/liveRequisition/hospitalRegistr')">入院登记</a>
            </li>
            <li class="active">
                <a href="#" >登记信息</a>
            </li>
        </ul>
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="col-lg-6" id="hospitalRegistrLeft">
                    <jsp:include page="hospitalRegistrLeft.jsp"></jsp:include>
                </div>
                <div class="col-lg-6" id="hospitalRegistrRight">
                  <%--  <section class="main-content col-lg-13" id="rightCenterDiv">--%>
                            <jsp:include page="hospitalRegistrRight.jsp"></jsp:include>
                   <%-- </section>--%>
                </div>
            </div>
        </section>
    </div>
</div>